package queue;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class QueueController {

	Queue queue;
	QueueGUI queueGUI;

	public QueueController(Queue queue, QueueGUI queueGUI) {
		this.queue = queue;

		this.queueGUI = queueGUI;
		queueGUI.addbuildQueueButtonListener(new BuildQueueController());

	}

	class BuildQueueController implements ActionListener {

		public void actionPerformed(ActionEvent e) {
			queueGUI.setBuildQueueButtonEnabled(false);
			Thread thread = new Thread(queue);
			thread.start();

		}
	}

}
